package com.uyun.rbac.user.service.impl;

import com.uyun.rbac.permission.entity.GroupEntity;
import com.uyun.rbac.permission.entity.UserEntity;
import com.uyun.rbac.user.dao.UserDao;
import com.uyun.rbac.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserDao userDao;
	
	
	@Override
	public List<UserEntity> getUserList(Map<String,Object> paraMap){
		return userDao.getUserList(paraMap);
	}

	@Override
	public UserEntity getUserEntityByUserName(String userName){
		return userDao.getUserEntityByUserName(userName);
	}

    @Override
    public List<GroupEntity> getAllUserGroup(){
        return userDao.getAllUserGroups();
    }

    @Override
    public boolean editUserGroup(String userId,String groupId){

        int count = userDao.uptUserGroup(userId,groupId);

        return count>0 ;

    }


}
